home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 11 Learning / 04 Mommersteeg / Tennis / DirectDraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-23  |  2.7 KB  |  57 lines

  1. //----------------------------------------------------------------------------------------------
  2. // Sequential Prediction Demo: The positioning pattern
  3. // 
  4. // Author:  Fri Mommersteeg
  5. // Date:    10-09-2001
  6. // File:    DirectDraw.h
  7. //----------------------------------------------------------------------------------------------
  8.  
  9. #ifndef __DIRECTDRAW_H
  10. #define __DIRECTDRAW_H
  11.  
  12. //----------------------------------------------------------------------------------------------
  13. // Global type definitions (new version independant names for weird DX identifiers)
  14. //----------------------------------------------------------------------------------------------
  15.  
  16. typedef LPDIRECTDRAW7                LPDD;
  17. typedef LPDIRECTDRAWSURFACE7        LPDDS;
  18. typedef LPDIRECTDRAWCLIPPER            LPDDC;
  19. typedef DDSURFACEDESC2                DDSD;
  20. typedef DDPIXELFORMAT                DDPF;
  21.  
  22. //----------------------------------------------------------------------------------------------
  23. // External declarations
  24. //----------------------------------------------------------------------------------------------
  25.  
  26. extern LPDD        lpdd;
  27. extern LPDDS    lpddps;
  28. extern LPDDS    lpddss;
  29.  
  30. //----------------------------------------------------------------------------------------------
  31. // Exported DirectDraw helper functions
  32. //----------------------------------------------------------------------------------------------
  33.  
  34. extern BOOL InitDD(HWND hWnd, DWORD dwWidth, DWORD dwHeight, DWORD dwBitsPerPixel, DWORD dwBackBufferCount = 0);
  35. extern BOOL ShutdownDD();
  36. extern BOOL CreateSurface(LPDDS &lpdds, DWORD dwWidth, DWORD dwHeight);
  37. extern BOOL CopyBitmap(LPDDS lpdds, HBITMAP hbm, int x, int y, int dx, int dy);
  38. extern BOOL CreateSurface(LPDDS &lpdds, const char * filename, DWORD dx = 0, DWORD dy = 0);
  39. extern BOOL CreateClipper(LPDIRECTDRAWCLIPPER &Clipper, LPRECT ClipList, DWORD nListSize);
  40. extern BOOL CreateClipper(LPDIRECTDRAWCLIPPER &Clipper, HWND hWnd);
  41. extern BOOL CreatePalette(LPDIRECTDRAWPALETTE &Palette, PALETTEENTRY * Entries);
  42. extern BOOL VerifyDD();
  43. extern BOOL Blit(LPDDS Source, LPDDS Dest, DWORD x, DWORD y);
  44. extern BOOL Blit(LPDDS Source, LPRECT SrcRect, LPDDS Dest, LPRECT DstRect, DWORD ColorKey);
  45. extern BOOL Fill(LPRECT Region, DWORD Color, LPDDS lpdds);
  46. extern BOOL Fill(DWORD x1, DWORD y1, DWORD x2, DWORD y2, DWORD Color, LPDDS lpdds);
  47. extern BOOL Flip();
  48. extern BOOL LoadSurface(const char * filename, DWORD dx, DWORD dy, LPDDS lpdds);
  49. extern BOOL Lock(LPDDS lpdds, DDSD &ddsd);
  50. extern BOOL Unlock(LPDDS lpdds);
  51. extern DWORD ColorMatch(COLORREF rgb, LPDDS lpdds);
  52. extern BOOL GetSurfaceSize(LPDDS lpdds, LPRECT Size);
  53.  
  54. //----------------------------------------------------------------------------------------------
  55. #endif
  56.  
  57.